﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Web.master" AutoEventWireup="true"
    CodeFile="CommuntyManage.aspx.cs" Inherits="Platform_CommuntyManage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="../Scripts/validform.js" type="text/javascript"></script>
    <script src="../Scripts/YJPopup.js" type="text/javascript"></script>
    <script src="../Scripts/GiveTip.js" type="text/javascript"></script>
    <script type="text/javascript">
        var MyPopup;
        $(document).ready(function () {
            MyPopup = new YJPopup({
                contentDivID: "NsContentDiv",
                dragBarDivID: "NsDragBar",
                dragable: true,
                autoCreate: true
            });
            $.checkForm();
        });
        function ShowPopup(ID) {
            MyPopup.Show("600px", "200px", "小区修改", "CommuntyModify.aspx?ID=" + encodeURIComponent(ID) + "&_" + Math.random());
        }
        function ShowPark(ID) {
            MyPopup.Show("500px", $(document).height() - 150, "停车场", "ParkManage.aspx?CommuntyID=" + encodeURIComponent(ID) + "&_" + Math.random());
        }
        function ClosePopup() {
            MyPopup.Hide();
        } 
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table class="tabContent">
        <tr>
            <th lang="th">
                小区添加
            </th>
        </tr>
        <tr>
            <td lang='td'>
                <table style="border-collapse: separate" cellpadding="2">
                    <tr>
                        <td>
                            小区：
                        </td>
                        <td>
                            <NC:FTextBox ID="txtCommuntyName" runat="server" CheckGroup="Add" />
                        </td>
                        <td>
                            地区：
                        </td>
                        <td>
                            <NC:AreaSelect runat="server" ID="Area" CheckGroup="Add">
                            </NC:AreaSelect>
                        </td>
                        <td align="center">
                            <asp:Button ID="btnAdd" runat="server" class="btn" CheckGroup="Add" Text="添加" OnClick="btnAdd_Click" />
                            <asp:Button ID="btnBindData" runat="server" Text="更新" CssClass="hidden" uncheck="true"
                                OnClick="btnBindData_Click" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <th colspan="4" lang="th">
                小区列表
            </th>
        </tr>
        <tr>
            <td lang="td">
                <NC:FGridView ID="FGridView1" runat="server" AutoCreateNumber="true" AutoGenerateColumns="false"
                    ShowFooter="true" DataKeyNames="CommuntyID" Width="560px">
                    <Columns>
                        <asp:BoundField HeaderText="小区名称" DataField="CommuntyName" />
                        <asp:TemplateField HeaderText="地区" ItemStyle-Width="160px">
                            <ItemTemplate>
                                <%# NS.BLL.Systems.AreaService.GetAreaNameStr(Convert.ToString(Eval("AreaNumber")))%></a>
                            </ItemTemplate>
                        </asp:TemplateField>
                       <%-- <asp:TemplateField HeaderText="停车场" ItemStyle-Width="60px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <input type="button" class="Gridbtn" value="设置" onclick="ShowPark(<%# Eval("CommuntyID") %>);" />
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                        <asp:TemplateField HeaderText="操作" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <input type="button" class="Gridbtn" value="修改" id="btnUpdate" onclick="ShowPopup(<%# Eval("CommuntyID") %>);" />
                                <asp:Button runat="server" class="Gridbtn" Text="删除" ID="btnDel" OnClientClick="GiveTip(event,'您确定删除吗？');"
                                    OnClick="btnDel_Click" CommandArgument='<%# Eval("CommuntyID") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </NC:FGridView>
            </td>
        </tr>
    </table>
</asp:Content>
